{* Component: MassMail *}
<script type="text/javascript">
{literal}
function callNextRound()
{
    document.getElementById('btn').click();
}
function checkRec()
{
    var oSel = document.getElementById('dSel');
    var oInp = document.getElementById('iSel');

    if(oSel.value == 'none' && oInp.value.length == 0)
    {
    {/literal}
        alert('{language text="please_select_membership_or_a_membe"}');
    {literal}
        return false;
    }
    else
        return true;
}
{/literal}
</script>
<table style="width:100%;" cellspacing="0">
	<tr>
		<td>
		{$jsValMess}
		{if !empty($aErrors) || !empty($aMess)}
		{messages block='MassMail'}
		<br />
		{/if}
		{if $bProc}
			<div class="border13" style="padding:5px;">
			<script type="text/javascript">window.setTimeout("callNextRound();", 2000);</script>
			{language text="emails_are_being_sent_out"} {str_replace text="`sending_ifrom_ito_out_of_itotal`" iFrom="`$iFrom`" iTo="`$iTo`" iTotal="`$iTotal`" }
			</div>
			<br /><br />
		{/if}
		<form method="post" name="fMail" action="{$sUrl}" onsubmit="if(checkRec()){$jsValidation}; else return false;">
		<input type="hidden" name="iCurPage" value="{$iCurPage}" />
			<table cellspacing="0" width="100%" class="forumline">
			<tr>
				<td class="row-header" colspan="2"><span>{language text="mass_email"}</span></td>
			</tr>
			<tr>
				<td class="catBottom" colspan="2">
				<div style="font-size:10pt;">
					{language text="from_here_you_can_send_out_emails_t"}<br /><br />
					<b>{language text="note_615"}:</b>
					<ul>
						<li>{language text="this_may_take_a_few_minutes_dependi"}</li>
						<li>{literal}{%USERNAME%}{/literal} = {language text="the_members_name_when_the_email_wil"}</li>
						<li>{language text="emails_will_be_sent_out_in_html_for"}</li>
					</ul>
				</div>
				</td>
			</tr>
			<tr>
				<th colspan="2" align="center"><span class="gensmall"></span></th>
			</tr>
			<tr>
				<td class="row1" width="25%" style="text-align:right;"><span class="gen">{language text="send_to"}:</span></td>
				<td class="row2">

					<select id="dSel" name="aMail[to]" style="width:150px;">
						{html_options options=$aShip selected=$aMail.to}
					</select>
					{language text="or_a_member"}: <input id="iSel" type="text" name="aMail[user]" value="{$aMail.user}" size="40" />

				</td>
			</tr>
			<tr>
				<td class="row1" style="text-align:right;"><span class="gen">{language text="e_mail_total"}</span></td>
				<td class="row2">

					<select name="aMail[total]" style="width:150px;">
					   {html_options options=$aRound selected=$aMail.total}
					</select>

				</td>

			</tr>
			<tr>
				<td class="row1" style="text-align:right;"><span class="gen">{language text="subject"}</span></td>
				<td class="row2">

					<input type="text" name="aMail[title]" value="{$aMail.title}" size="40" />

				</td>
			</tr>
			<tr>
				<td class="row1" style="text-align:right;vertical-align:top;"><span class="gen">{language text="message"}</span></td>

				<td class="row2">

					<textarea cols="50" rows="20" style="width:100%;" name="aMail[text]">{$aMail.text}</textarea>

				</td>
			</tr>
			<tr>
				<td class="catBottom" style="text-align:right;"></td>
				<td class="catBottom" style="text-align:left;font-size:8pt;">
					<input type="submit" id="btn" name="act[SendMail]" value=" {language text="send_emails"} " />
				</td>

			</tr>
			</table>
		</form>
		<br /><br />
		</td>
	</tr>
</table>